<?php
$smarty->configLoad($lang . '/buyeditems.module.php');
$language = parse_ini_file($lang . '/breadcrumb.module.php', true);
$breadcrumb = $language['buyeditems'];
$sql = 'SELECT *, COUNT(item_unique_id) AS count FROM '.DB_LOGIN.'.aionshop_transactions GROUP BY item_unique_id ORDER BY count DESC';
$dbh = $connection->prepare($sql);
$dbh->execute();
foreach ($dbh->fetchAll(PDO::FETCH_ASSOC) as $row) {
    $value[] = $row;
}
$smarty->assign('value', $value);
$template = 'buyeditems/index.tpl';
?>